<template>
  <div>
    <input type="text" placeholder="小狗的名字" v-model="dog.name" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      dog: {
        name: 0,
      },
    }
  },
  watch: {
    // dog(newValue, oldValue) {
    //   console.log(newValue)
    //   console.log(oldValue)
    // },
    dog: {
      handler(newValue, oldValue) {
        console.log(newValue)
        console.log(oldValue)
      },
      immediate: true,
      deep: true,
    },
  },
}
</script>

<style></style>
